        $(function () {
				$.ajaxSetup({
					cache: false,
					headers: {
						"header":localStorage.getItem("token")
					}
				});
            $("#tt").datagrid({
            	idField : 'id',
            	title: "",
                url : basePath + "assets/page",
                width: "100%",  
                height: "550px",
                singleSelect : false, /* 是否选中一行 */
                pagination : true,/* 是否显示下面的分页菜单 */
                border:true,
                rowStyler: function() {
                	　　return 'height: 60px';
                	},
				onClickRow: function(index,row){
					$("#tt").datagrid("clearSelections");
				},
                rownumbers:true,
                columns : [ [  {field : 'id', checkbox: false,hidden:true},
								{field : 'bank',title : '银行',width : '20%',align : 'center'},
								{field : 'money',title : '金额(元)',width : '20%',align : 'center'},
								{field : 'lastedUpdateTime',title : '最近更新时间',width : '25%',align : 'center'},
								{field : 'op',title : '操作',width : '100',align : 'center',
								formatter:function(value,row,index){
									var id = row.id.toString();
									var del = '<a href="#" onclick="toModify(\'' + id + '\')">修改</a>';
									//var del = "<a class='fonta' href='#' " + "onclick=doDelete(" + id +");>删除<a/>";

									var blank = "&nbsp;&nbsp;|";
									return del;
								}
					}

                ]],
            	loadMsg : '数据加载中,请稍候......'
            }); 
  
            var p = $('#tt').datagrid('getPager');  
            $(p).pagination({  
                /*
				 * 页数文本框前显示的汉字 修改每页默认条数 搜索pageList在jquery.easyui.min.js中修改，
				 * 分页区下拉分页数量集合和默认每页分页条数 striped属性 交替行换色
				 */  
                beforePageText: '第',  
                afterPageText: '页    共 {pages} 页',  
                displayMsg: '当前显示 {from}-{to} 条记录,共 {total} 条记录'  
            });

        }
        );
        // 搜索
        function doSearch() {
            $('#tt').datagrid('load', {  

			});
        }


        
        function clearQry() {
			//$("#measureTime1").datebox("setValue","");
			//$("#measureTime2").datebox("setValue","");

			$("#qryForm")[0].reset();
			$("[name='payDate1']").val("");
			$("[name='payDate2']").val("");
			doSearch();
		}



		function toModify(id){
			var title = "修改金额";
			$('#modifyAssetsDlg').css("top","0").dialog({
				title: title,
				width: 500,
				height: 300,
				closed: false,
				cache: false,
				href: basePath + 'navigator?page=/assets/modify&id=' + id,
				modal: true
			});
		}


        // 新增
        function submitUpdateAssets(){
			$.ajax({
				type:"put",
				url:basePath + "assets/update",
				beforeSend: function(request) {
					request.setRequestHeader("header", localStorage.getItem("token"));
				},
				data : $('#updateff').serializeArray(),
				cache:false,
				dataType: "json",
				success:function(result) {
					$.messager.show({
						title:'提示',
						msg:result.result,
						timeout:5000,
						showType:'slide'
					});
					cancelDlg("modifyAssetsDlg");
					$('#tt').datagrid('reload');// 刷新
				}
			});
        }

		function doSearchAll() {
			$.ajax({
				type:"get",
				url:basePath + "assets/searchAll",
				beforeSend: function(request) {
					request.setRequestHeader("header", localStorage.getItem("token"));
				},
				cache:false,
				dataType: "json",
				success:function(result) {
					$.messager.alert('SUCCESS',result.result,'SUCCESS');
				}
			});
		}

		function doSearchCash() {
			$.ajax({
				type:"get",
				url:basePath + "assets/searchAllCash",
				beforeSend: function(request) {
					request.setRequestHeader("header", localStorage.getItem("token"));
				},
				cache:false,
				dataType: "json",
				success:function(result) {
					$.messager.alert('SUCCESS',result.result,'SUCCESS');
				}
			});
		}


        // 删除
        function doDelete(id) {
        	$.messager.confirm('提示', '你确定要删除这条记录吗?',function(r){
        		if(r){
        			$.ajax({
                        type:"delete",
                        url:basePath + "expenses/delete/" + id,
                        cache:false,
                        dataType: "json", // this is important
                        success:function(result) {
                         	$.messager.show({
                         		title:'提示',
                         		msg:'成功',
                         		timeout:5000,
                         		showType:'slide'
                         	});
                        	$('#tt').datagrid('reload');// 刷新
                        }
                    });
        		}

        	})
           
        }
        // 关闭弹窗
        function cancelDlg1(){
        	$('#addExpensesDlg').dialog("close");
        }
        //关闭弹窗
        function cancelDlg(dlgName){
        	$('#'+dlgName).dialog("close");
        }




		



